package com.tsingtree.modular.entity;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.converters.string.StringImageConverter;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.*;
import com.tsingtree.config.excel.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Date;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author jagger
 * @since 2023-08-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="NanUser对象", description="用户")
@ExcelIgnoreUnannotated
@HeadRowHeight(value = 20)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
//@ContentFontStyle(fontHeightInPoints = 20)
@ContentRowHeight(40)
//@ColumnWidth(10)
public class NanUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty(value = "用户ID", index = 0)
    private Integer id;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @ExcelProperty(value = "创建时间", index = 11)
    @ColumnWidth(20)
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.UPDATE)
    @ExcelProperty(value = "更新时间", index = 12)
    @ColumnWidth(20)
    private Date updateTime;

    @ApiModelProperty(value = "版本号")
    @Version
    private Integer version;

    @ApiModelProperty(value = "注册IP")
    @ExcelProperty(value = "注册IP", index = 9)
//    @ColumnWidth(20)
    private String registerIp;

    @ApiModelProperty(value = "状态")
    @ExcelProperty(value = "状态", index = 3, converter = StatusConverter.class)
    private Integer status;

    @ApiModelProperty(value = "电子邮箱")
    @ExcelProperty(value = "电子邮箱", index = 1)
//    @ColumnWidth(20)
    private String email;

    @ApiModelProperty(value = "密码")
    private String pwd;

    @ApiModelProperty(value = "性别")
    @ExcelProperty(value = "性别", index = 5, converter = GenderConverter.class)
    private Integer sex;

    @ApiModelProperty(value = "昵称")
    @ExcelProperty(value = "昵称", index = 6)
    private String nickName;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "生日")
    @ExcelProperty(value = "生日", index = 7)
    private String birthday;

    @ApiModelProperty(value = "国家")
    @ExcelProperty(value = "国家", index = 8)
    private String country;

    @ExcelProperty(value = "头像", converter = ImageConverter.class)
    @TableField(exist = false)
    private URL url;

    @ExcelProperty(value = "运营组ID", index = 2)
    @TableField(exist = false)
    private Integer sellerId;

    @ExcelProperty(value = "设备码", index = 4)
    @TableField(exist = false)
    private String deviceCode;

    @ExcelProperty(value = "登录设备", index = 10)
    private String device;

    private Boolean isOfficial;

    @ApiModelProperty(value = "是否SVIP")
    private Boolean isVip;

    private Boolean isAllowedAdd;

    private Integer chatCondition;

    private String tag;


}
